package com.sam.c_proxy;

import com.sam.service.IUserService;
import com.sam.service.impl.UserServiceImpl;
import org.junit.Test;

public class Demo {

    @Test
    public void fun1(){
        IUserService userService = new UserServiceImpl();

        UserServiceProxyFactory userServiceProxyFactory = new UserServiceProxyFactory(userService);

        IUserService userService1 = userServiceProxyFactory.getUserServiceProxy();

        userService1.save();

        UserServiceProxyFactory2 userServiceProxyFactory2 = new UserServiceProxyFactory2();

        IUserService userService2 = userServiceProxyFactory2.getUserServiceProxy();

        userService2.delete();
    }

}
